package com.antaohua.tools.shares.job;

import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

import org.apache.commons.lang3.time.DateUtils;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.antaohua.tools.framework.base.exception.DeleteEntityException;
import com.antaohua.tools.framework.base.exception.InsertEntityException;
import com.antaohua.tools.framework.base.exception.QureyEntityException;
import com.antaohua.tools.shares.service.SharesStockService;
import com.antaohua.tools.system.base.quartz.JobBaseModel;



@Component
public class UpdateStocIndexJob extends JobBaseModel{

	@Autowired
	private SharesStockService stockService;
	
	
	@Override
	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
		try {
			stockService.updateAll("sh");
			stockService.updateAll("sz");
		} catch (IOException | InsertEntityException | QureyEntityException | DeleteEntityException
				| ParseException e) {
			throw new JobExecutionException(e);
		}
		
	}

	@Override
	protected String runClassCode() {
		// TODO Auto-generated method stub
		return "update_stock_list_job";
	}

	
	
	
	

}
